/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *如果数据库字段发生变化，请在代码生器重新生成此Model
 */
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MYData.Entity.SystemModels;

namespace MYData.Entity.DomainModels
{
    [Entity(TableCnName = "项目立项审核", TableName = "tb_project_baseinfo")]
    public partial class tb_project_baseinfo : BaseEntity
    {
        /// <summary>
        ///项目主键
        /// </summary>
        [Key]
        [Display(Name = "项目主键")]
        [MaxLength(64)]
        [Column(TypeName = "nvarchar(64)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string projectId { get; set; } = new Snowflake.Core.IdWorker(1, 1).NextId().ToString();

        /// <summary>
        ///项目名称
        /// </summary>
        [Display(Name = "项目名称")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string projectName { get; set; }

        /// <summary>
        ///项目编号
        /// </summary>
        [Display(Name = "项目编号")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string projectNumber { get; set; }

        /// <summary>
        ///成果归属部门
        /// </summary>
        [Display(Name = "成果归属部门")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string projectDepartresult { get; set; }

        /// <summary>
        ///负责人所属部门
        /// </summary>
        [Display(Name = "负责人所属部门")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        public string projectDepartperson { get; set; }

        /// <summary>
        ///科研秘书联系方式
        /// </summary>
        [Display(Name = "科研秘书联系方式")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        public string secretaryPhone { get; set; }

        /// <summary>
        ///立项年度
        /// </summary>
        [Display(Name = "立项年度")]
        [Column(TypeName = "int")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public int projectYear { get; set; }

        /// <summary>
        ///登记人
        /// </summary>
        [Display(Name = "登记人")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        public string projectWriteperson { get; set; }

        /// <summary>
        ///专项经费(万元)
        /// </summary>
        [Display(Name = "专项经费(万元)")]
        [DisplayFormat(DataFormatString = "10,2")]
        [Column(TypeName = "decimal")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public decimal specialMoney { get; set; }

        /// <summary>
        ///学科门类
        /// </summary>
        [Display(Name = "学科门类")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string projectSubject { get; set; }

        /// <summary>
        ///结束时间
        /// </summary>
        [Display(Name = "结束时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public DateTime projectEndtime { get; set; }

        /// <summary>
        ///项目类型
        /// </summary>
        [Display(Name = "项目类型")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string projectType { get; set; }

        /// <summary>
        ///项目来源单位
        /// </summary>
        [Display(Name = "项目来源单位")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        public string projectScoreunit { get; set; }

        /// <summary>
        ///项目承担单位
        /// </summary>
        [Display(Name = "项目承担单位")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        public string projectUndertakeunit { get; set; }

        /// <summary>
        ///是否委托外单位进行测试或测试加工
        /// </summary>
        [Display(Name = "是否委托外单位进行测试或测试加工")]
        [Column(TypeName = "bool")]
        [Editable(true)]
        public bool? projectEntrust { get; set; }

        /// <summary>
        ///备注
        /// </summary>
        [Display(Name = "备注")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        public string projectRemark { get; set; }

        /// <summary>
        ///是否涉及人体
        /// </summary>
        [Display(Name = "是否涉及人体")]
        [Column(TypeName = "bool")]
        [Editable(true)]
        public bool? touchPerson { get; set; }

        /// <summary>
        ///人体补充
        /// </summary>
        [Display(Name = "人体补充")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        public string personRemark { get; set; }

        /// <summary>
        ///负责人
        /// </summary>
        [Display(Name = "负责人")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string projectPerson { get; set; }

        /// <summary>
        ///科研秘书(负责成果、经费)
        /// </summary>
        [Display(Name = "科研秘书(负责成果、经费)")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string projectSecretary { get; set; }

        /// <summary>
        ///负责人类型
        /// </summary>
        [Display(Name = "负责人类型")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string projectPersontype { get; set; }

        /// <summary>
        ///登记时间
        /// </summary>
        [Display(Name = "登记时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public DateTime projectWritetime { get; set; }

        private decimal a;
        /// <summary> 
        ///项目经费(万元)
        /// </summary>
        [Display(Name = "项目经费(万元)")]
        [Column(TypeName = "decimal")]
        [Editable(true)]
        public decimal? projectMoney  { get; set; }
        //{
        //    get
        //    {
        //        return 200;
        //    }
        //    set
        //    {
        //        if (projectMoney == specialMoney + supportMoney)
        //        {
        //            a = (decimal)projectMoney;
        //        }
        //        else
        //        {
        //            a = 0;
        //        }
        //    }
        //}

        /// <summary>
        ///配套经费(万元)
        /// </summary>
        [Display(Name = "配套经费(万元)")]
        [DisplayFormat(DataFormatString = "10,2")]
        [Column(TypeName = "decimal")]
        [Editable(true)]
        public decimal? supportMoney { get; set; }

        /// <summary>
        ///项目开始时间
        /// </summary>
        [Display(Name = "项目开始时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public DateTime projectStarttime { get; set; }

        /// <summary>
        ///研究类型
        /// </summary>
        [Display(Name = "研究类型")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string projectStudytype { get; set; }

        /// <summary>
        ///项目级别
        /// </summary>
        [Display(Name = "项目级别")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string projectLevel { get; set; }

        /// <summary>
        ///项目类别
        /// </summary>
        [Display(Name = "项目类别")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        public string projectKind { get; set; }

        /// <summary>
        ///创建人
        /// </summary>
        [Display(Name = "创建人")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        public string? Creator { get; set; }

        /// <summary>
        ///创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? CreateDate { get; set; }

        /// <summary>
        ///修改人
        /// </summary>
        [Display(Name = "修改人")]
        [MaxLength(255)]
        [Column(TypeName = "nvarchar(255)")]
        [Editable(true)]
        public string? Modifier { get; set; }

        /// <summary>
        ///修改时间
        /// </summary>
        [Display(Name = "修改时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? ModifyDate { get; set; }

        /// <summary>
        ///软删除
        /// </summary>
        [Display(Name = "软删除")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? IsDel { get; set; }
        /// <summary>
        ///是否暂存
        /// </summary>
        [Display(Name = "是否暂存")]
        [Column(TypeName = "bool")]
        [Editable(true)]
        public bool? isTs { get; set; }


    }
}